package com.my;//package com.my.thread;
//
//import com.my.autoSpi.TranslationService;
//import com.my.processor.test.four.Version;
//import com.my.processor.test.one.PrintMe;
//import com.my.processor.test.three.BindView;
//import com.my.processor.test.two.TestAnnotation;
//import org.junit.Test;
//
//import java.util.Locale;
//import java.util.ServiceLoader;
//import java.util.function.Consumer;
//import java.util.stream.StreamSupport;
//
//import static org.junit.Assert.assertEquals;
//
///**
// * @author timo 2021/2/19
// */
//@Version(major = 3,minor = 2)
//public class SPITestClass {
//
//    @Test
//    public void myTestForSPI(){
//        ServiceLoader<TranslationService> loader = ServiceLoader.load(TranslationService.class);
//        long count = StreamSupport.stream(loader.spliterator(), false).count();
//        loader.forEach(new Consumer<TranslationService>() {
//            @Override
//            public void accept(TranslationService translationService) {
//                Locale localeFrom = new Locale("en");
//                Locale localeFo = new Locale("zh");
//                String message = translationService.translate("app", localeFrom,localeFo);
//                System.out.println(message);
//            }
//        });
//        assertEquals(2, count);
//    }
//
//    @TestAnnotation(value = 5, what = "This is a test")
////    @PrintMe
//    @BindView(value = 123)
//    public static String msg = "Hello world!";
//    @PrintMe
//    public static void main(String[] args) {
//        System.out.println(msg);
//    }
//
//
//}
//
